<?php


/**
 * Description of Category
 *
 * @author Admin
 */
class Asset_Resource_Category extends WOW_Model_Resource_Db_Table_Abstract implements
Asset_Resource_Category_Interface
{
    protected $_name = 'asset_categories';
    protected $_primary = 'catid';
    protected $_rowClass = 'Asset_Resource_Category_Item';
    protected $_dependentTables = array('Asset_Resource_Subcategory');

    public function getCategoryById($id)
    {
        return $this->find($id)->current();
    }

    public function getAllCategories()
    {
        $select = $this->select()
                       ->order('CategoryName');
        // echo $select->__toString();

        return $this->fetchAll($select);
    }

    public function getCategoryByIdent($ident)
    {
        $select = $this->select()
                       ->where('catident = ?', $ident);

        return $this->fetchRow($select);
    }


}
?>
